package nc.spring.bill.manage;



import java.util.ArrayList;
import java.util.List;

import nc.ui.pub.bill.BillEditEvent;
import nc.ui.trade.bill.AbstractManageController;
import nc.ui.trade.bocommand.IUserDefButtonCommand;
import nc.ui.trade.manage.BillManageUI;
import nc.ui.trade.manage.ManageEventHandler;
import nc.vo.pub.CircularlyAccessibleValueObject;

public class ManageUI extends BillManageUI{
	public ManageUI(){
		this.plugin=((nc.spring.bill.manage.ManageHander)getManageEventHandler()).getPlugin();
	}

	@Override
	protected AbstractManageController createController(){

		return new ManageCtrl();
	}

	@Override
	protected ManageEventHandler createEventHandler(){

		return new nc.spring.bill.manage.ManageHander(this,getUIControl());
	}

	@Override
	public void setBodySpecialData(CircularlyAccessibleValueObject[] arg0) throws Exception{

	}

	@Override
	protected void setHeadSpecialData(CircularlyAccessibleValueObject arg0,int arg1) throws Exception{

	}

	@Override
	protected void setTotalHeadSpecialData(CircularlyAccessibleValueObject[] arg0) throws Exception{

	}

	@Override
	protected void initSelfData(){

	}

	@Override
	public void setDefaultData() throws Exception{

	}

	private List<IUserDefButtonCommand> bos=null;

	public List<IUserDefButtonCommand> getUserButtons(){
		if(bos==null) bos=creatUserButtons();
		return bos;
	}

	protected List<IUserDefButtonCommand> creatUserButtons(){

		List<IUserDefButtonCommand> bos=new ArrayList<IUserDefButtonCommand>();
		return bos;
	}

	@Override
	public void afterEdit(BillEditEvent arg0){
		if(plugin!=null){
			plugin.afterEdit(arg0,this);
		}
		super.afterEdit(arg0);
	}

	@Override
	public boolean beforeEdit(BillEditEvent arg0){
		if(plugin!=null){
			plugin.beforeEdit(arg0,this);
		}
		return super.beforeEdit(arg0);
	}

	ISpringPlugin plugin=null;

	public ISpringPlugin getPlugin(){
		return plugin;
	}

	public void setPlugin(ISpringPlugin plugin){
		this.plugin=plugin;
	}

}
